<?php 
include_once('db.php');
if ($_POST['submit']) {
	$email=$_POST['email'];
	$password=$_POST['password'];
	$repassword=$_POST['repassword'];
	$random=$_POST['random'];
	$time=time('Y-m-d H-i-s');
	$db=new DB();
	$sql="select * from user where email='$email'";
	if ($db->get($sql)) {
		echo "该用户已注册！";
	} else {
		if ($password==$repassword) {
		$sql="insert into user values(null,
		'$email','$password','$repassword','$random',$time
		)";
		$db->insert($sql);
		} else {
			echo "前后输入密码不一致，请重新输入";
		}
	}
} 

 ?>